from fastapi import APIRouter, Depends, FastAPI

from app.api.admin.schema.shop.shop import ShopInSchema
from app.api.admin.service.shop.shop import ShopService
from app.utils.res import unified_resp


shop = APIRouter(prefix="/shop",tags=["店铺管理"])


@shop.post("/detail")
@unified_resp
async def detail(shop_service: ShopService = Depends(ShopService.instance)):
    return await shop_service.detail()


@shop.post("/edit")
@unified_resp
async def edit(shop_in: ShopInSchema, shop_service: ShopService = Depends(ShopService.instance)):
    return await shop_service.edit(shop_in)

@shop.post("/update_image")
@unified_resp
async def update_image(shop_in: ShopInSchema, shop_service: ShopService = Depends(ShopService.instance)):
    return await shop_service.update_image(shop_in)